/**
 * Created by sa on 2016/9/22.
 */


var casper = require('casper').create();

casper.start();

casper.userAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X)');

casper.thenOpen('http://wj.qq.com/', function() {
  this.echo("I'm a Mac.");
  this.echo(this.status(true));
  this.userAgent('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)');
});

casper.thenOpen('http://www.baidu.com/', function() {
  this.echo("I'm a PC.");
  this.echo(this.status(true));
});

casper.then( function() {
  this.echo(this.getCurrentUrl());
});


casper.run();
